package com.yxzc.chapter06.constructor.SetGetDemo

/**
 *
 * @author wu
 * @create 2021-09-09-11:29 
 */
class Persion( inAge: Short) {
  var age: Short = inAge
  var name: String = _

  def this(n: String, m: Short) {
    this(12)
    this.name = n
    this.age = m
  }

  override def toString: String = {
    "name = "+name+"age = "+age
  }

}

object Testo {
  def main(args: Array[String]): Unit = {
    /*var p = new Persion("ok", 30)
    println(p.toString)*/
    var b = new B("OK")

  }
}
class A(){
  var name :String  = _
  def this(name : String){
    this()
    this.name = name
    println("1")
    println("A = name = "+this.name)
  }
  println("AAA~~~")
}
class B() extends  A(){
  println("BBB")
  def this(name :String){
    this
    println("A this(+"+name+":String)")
  }
}
